package com.dmzapp.cashoffer;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.dmzapp.cashoffer.vo.UserAccount;
import com.huluwa.fczapp.cashoffer.R;

public class ExchangeCenterActivity extends SuperActivity {

    private RelativeLayout qqitem;
    private RelativeLayout phoneitem;
    private RelativeLayout alipayitem;
    
    private TextView rest;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.exchange_center);
        
        qqitem = (RelativeLayout) findViewById(R.id.qq_exchange);
        phoneitem = (RelativeLayout) findViewById(R.id.phone_exchange);
        alipayitem = (RelativeLayout) findViewById(R.id.alipay);
        
        rest = (TextView) findViewById(R.id.rest);
        rest.setText(UserAccount.getInstance().getRest());
        qqitem.setOnClickListener(new QQItemOnclickListener());
        phoneitem.setOnClickListener(new PhoneItemOnclickListener());
        alipayitem.setOnClickListener(new AlipayItemOnclickListener());
        
    }
    
    @Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();
        rest.setText(UserAccount.getInstance().getRest());
    }
    
    class QQItemOnclickListener implements OnClickListener{

        @Override
        public void onClick(View v) {
            Intent intent = new Intent();
            intent.setClass(ExchangeCenterActivity.this, QBExchange.class);
            startActivity(intent);
        }
        
    }
    class PhoneItemOnclickListener implements OnClickListener{

        @Override
        public void onClick(View v) {
            Intent intent = new Intent();
            intent.setClass(ExchangeCenterActivity.this, PhoneExchange.class);
            startActivity(intent);
        }
        
    }
    class AlipayItemOnclickListener implements OnClickListener{

        @Override
        public void onClick(View v) {
            Intent intent = new Intent();
            intent.setClass(ExchangeCenterActivity.this, AlipayExchange.class);
            startActivity(intent);
        }
        
    }
}

